package com.sugou.web.servlet;

import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import com.opensymphony.module.sitemesh.freemarker.FreemarkerDecoratorServlet;

import freemarker.template.Configuration;

public class GouWuDecoratorServlet extends FreemarkerDecoratorServlet{
	private static final long serialVersionUID = 3090485933817206760L;
	protected Configuration createConfiguration() {
		try{
			FreeMarkerConfigurer freemarkerConfig=WebApplicationContextUtils.getWebApplicationContext(this.getServletContext()).getBean("freemarkerConfig",FreeMarkerConfigurer.class);
			return freemarkerConfig.createConfiguration();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}